/* 
 * File:   Locker.h
 * Author: ben
 *
 * Created on November 11, 2012, 12:33 PM
 */

#ifndef LOCKER_H
#define	LOCKER_H

#include <pthread.h>

class Locker{
    
public:
    /**
     * Defaults constructor
     */
    Locker();
    /**
     * Waits on the class condition
     */
    void wait();
    /**
     * Signals the class condition
     */
    void notify();
    /**
     * Locks the class mutex
     */
    void Lock();
    /**
     * Unlocks the class mutex
     */
    void Unlock();
    
private:
    /**
     * Class mutex and condition
     */
    static pthread_mutex_t myMutex;
     pthread_cond_t myCondition;
};

#endif	/* LOCKER_H */

